package model

// Item represents the items table
type Item struct {
	BaseModel
	Name      string  `gorm:"column:name;NOT NULL" json:"name"`
	Price     float64 `gorm:"column:price;NOT NULL;type:decimal(10,2)" json:"price"`
	Img       string  `gorm:"column:img;NOT NULL" json:"img"`
	Rest      int     `gorm:"column:rest;NOT NULL" json:"rest"`
	IsOnShelf bool    `gorm:"column:isOnShelf;NOT NULL" json:"is_on_shelf"`
}

// TableName sets the insert table name for this struct type
func (i *Item) TableName() string {
	return "items"
}
